package cassys.actions.assessmentGroupManagement;

import cassys.domain.assessment.AssessmentGroup;
import cassys.ejb.clients.ModuleManagementDelegate;
import com.opensymphony.xwork2.ActionSupport;
import cassys.domain.classManagement.*;
import cassys.ejb.clients.AssessmentManagementDelegate;
import java.util.List;

/**
 *
 * @author User
 */
public class ListAssessmentGroups extends ActionSupport {

    private AssessmentManagementDelegate assessmentDelegate;
    private List<AssessmentGroup> assessmentGroups;

    public ListAssessmentGroups() {
        assessmentDelegate = new AssessmentManagementDelegate();
    }
    
    public String newAssessmentGroup(){
        return SUCCESS;
    }

    @Override
    public String execute() throws Exception {
        System.out.println("Listing Assessment Group");
        this.assessmentGroups=assessmentDelegate.getAllAssessmentGroup(getAssessmentId());
        System.out.println("got the Assessment Group :"+assessmentGroups.size());
        return SUCCESS;
    }

     public List<AssessmentGroup> getAssessmentGroups(){
        return assessmentGroups;
    }
     
    public long getAssessmentId(){
        return 1;
    }
    
}
